# -*- coding: utf-8 -*-
# @Time : 2024/2/26 15:13
# @Author : ZH
# @File : 14.py
# @Software: PyCharm
class Solution(object):
    def longestCommonPrefix(self, strs):
        """
        :type strs: List[str]
        :rtype: str
        """
        if not strs:
            return ''
        min_str = min(strs, key=len)

        for index, s in enumerate(min_str):
            for str_ in strs:
                if str_[index] != s:
                    return min_str[:index]

        return min_str


